import http from '@/utils/http'
import type { MenuAddParams, MenuResopnse } from '../types/permission'

enum API {
    MenuList_URL = '/api/acl/menu/list',
    MenuAdd_URL = '/api/acl/menu/add',
    MenuEdit_URL = '/api/acl/menu/edit',
    MenuDelete_URL= '/api/acl/menu/delete'
}

// 获取菜单列表
export const reqMenuList = () => http.get<any, any>(API.MenuList_URL)

// 新增菜单列表
export const reqMenuAdd = (data: MenuAddParams) => http.post<any, MenuResopnse>(API.MenuAdd_URL, data)

// 编辑菜单
export const reqMenuEdit = (data: MenuAddParams) => http.get<any, MenuResopnse>(API.MenuEdit_URL, {params:data})

// 删除菜单
export const reqMenuDelete =(id:string)=>http.delete<any,MenuResopnse>(API.MenuDelete_URL,{params:{id}})